package cn.iocoder.yudao.module.pay.refund.mq;

import cn.iocoder.yudao.module.api.pay.refund.message.RefundFailureMessage;
import cn.iocoder.yudao.module.api.pay.refund.message.RefundSuccessMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 退款单据 事件消费者
 *
 * @author 山野羡民（1032694760@qq.com）
 */
@Component
@Slf4j
public class RefundOrderConsumer {

    @EventListener
    @Async // Spring Event 默认在 Producer 发送的线程，通过 @Async 实现异步
    public void onMessage(RefundSuccessMessage message) {
        log.info("[pay/refund][onMessage][退款成功事件({})]", message);
    }

    @EventListener
    @Async // Spring Event 默认在 Producer 发送的线程，通过 @Async 实现异步
    public void onMessage(RefundFailureMessage message) {
        log.info("[pay/refund][onMessage][退款失败事件({})]", message);
    }

}
